package eraserhead.boundary;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

import eraserhead.controller.WelcomeFormController;

/**
 * {@link JFrame} window for welcoming the user to DecisionLines.
 */
public class WelcomeForm extends JFrame {
	private static final long serialVersionUID = 5154447865098859572L;
	JButton createBtn;
    JButton joinBtn;
    JLabel welcome;
	
    /**
     * Creates and lays out the {@link WelcomeForm}
     */
	public WelcomeForm () {
		initComponents();
	}
	
    private void initComponents() {
    	
    	joinBtn = new javax.swing.JButton();
        createBtn = new javax.swing.JButton();
        welcome = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMaximumSize(new java.awt.Dimension(600, 480));
        setMinimumSize(new java.awt.Dimension(600, 480));
        setPreferredSize(new java.awt.Dimension(600, 480));

        joinBtn.setFont(new java.awt.Font("Felix Titling", 0, 18)); // NOI18N
        joinBtn.setText("Join Event");
        joinBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	new WelcomeFormController(WelcomeForm.this).joinEvent();
            }
        });

        createBtn.setFont(new java.awt.Font("Felix Titling", 0, 18)); // NOI18N
        createBtn.setText("Create Event");
        createBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	new WelcomeFormController(WelcomeForm.this).createEvent();
            }
        });

        welcome.setFont(new java.awt.Font("Felix Titling", 0, 36)); // NOI18N
        welcome.setText("WELCOME!");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(214, 214, 214)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(createBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(joinBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(201, 201, 201)
                        .addComponent(welcome)))
                .addContainerGap(210, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(99, 99, 99)
                .addComponent(welcome)
                .addGap(90, 90, 90)
                .addComponent(createBtn)
                .addGap(43, 43, 43)
                .addComponent(joinBtn)
                .addContainerGap(99, Short.MAX_VALUE))
        );

        pack();
    }


}
